home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 2000 #5
/
Amiga Plus CD - 2000 - No. 5.iso
/
Tools
/
Dev
/
lame_src
/
new_clock.c
< prev
next >
Wrap
C/C++ Source or Header
|
2000-01-01
|
431b
|
25 lines
/*
* Replacement for the buggy clock() function in GCC WarpUP.
* Written by Jarmo Laakkonen jami.laakkonen@kolumbus.fi
*
*/
#include <time.h>
#include <powerpc/powerpc_protos.h>
clock_t clock(void)
{
struct timeval tv;
static ULONG start_time = 0;
ULONG current_time;
GetSysTimePPC(&tv);
if (!start_time)
start_time = tv.tv_secs;
current_time = tv.tv_secs;
return (current_time - start_time) * CLOCKS_PER_SEC;
}